package model.Entity.SIS;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the SIS_ACTIVITIES database table.
 * 
 */
@Entity
@Table(name="SIS_ACTIVITIES")
@NamedQueries({
    @NamedQuery(name = "Activity.findAll", query = "SELECT s FROM Activity s"),
    @NamedQuery(name = "Activity.findByActivityCode", query = "SELECT s FROM Activity s WHERE s.activityCode = :activityCode"),
    @NamedQuery(name = "Activity.findByActivityDesc", query = "SELECT s FROM Activity s WHERE s.activityDesc = :activityDesc"),
    @NamedQuery(name = "Activity.findByActivityDescS", query = "SELECT s FROM Activity s WHERE s.activityDescS = :activityDescS"),
    @NamedQuery(name = "Activity.findByActivityShortcut", query = "SELECT s FROM Activity s WHERE s.activityShortcut = :activityShortcut"),
    @NamedQuery(name = "Activity.findByActivityShortcutS", query = "SELECT s FROM Activity s WHERE s.activityShortcutS = :activityShortcutS")})
public class Activity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="ACTIVITY_CODE")
	private Integer activityCode;

	@Column(name="ACTIVITY_DESC")
	private String activityDesc;

	@Column(name="ACTIVITY_DESC_S")
	private String activityDescS;

	@Column(name="ACTIVITY_SHORTCUT")
	private String activityShortcut;

	@Column(name="ACTIVITY_SHORTCUT_S")
	private String activityShortcutS;

	//bi-directional many-to-one association to SisCourseActivity
	@OneToMany(mappedBy="activity")
	private List<CourseActivity> courseActivities;

	public Activity() {
	}

	public Integer getActivityCode() {
		return this.activityCode;
	}

	public void setActivityCode(Integer activityCode) {
		this.activityCode = activityCode;
	}

	public String getActivityDesc() {
		return this.activityDesc;
	}

	public void setActivityDesc(String activityDesc) {
		this.activityDesc = activityDesc;
	}

	public String getActivityDescS() {
		return this.activityDescS;
	}

	public void setActivityDescS(String activityDescS) {
		this.activityDescS = activityDescS;
	}

	public String getActivityShortcut() {
		return this.activityShortcut;
	}

	public void setActivityShortcut(String activityShortcut) {
		this.activityShortcut = activityShortcut;
	}

	public String getActivityShortcutS() {
		return this.activityShortcutS;
	}

	public void setActivityShortcutS(String activityShortcutS) {
		this.activityShortcutS = activityShortcutS;
	}

	public List<CourseActivity> getSisCourseActivities() {
		return this.courseActivities;
	}

	public void setSisCourseActivities(List<CourseActivity> courseActivities) {
		this.courseActivities = courseActivities;
	}

	public CourseActivity addSisCourseActivity(CourseActivity courseActivity) {
		getSisCourseActivities().add(courseActivity);
		courseActivity.setSisActivity(this);

		return courseActivity;
	}

	public CourseActivity removeSisCourseActivity(CourseActivity courseActivity) {
		getSisCourseActivities().remove(courseActivity);
		courseActivity.setSisActivity(null);

		return courseActivity;
	}
	
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (activityCode != null ? activityCode.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Activity)) {
            return false;
        }
        Activity other = (Activity) object;
        if ((this.activityCode == null && other.activityCode != null) || (this.activityCode != null && !this.activityCode.equals(other.activityCode))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.SisActivities[ activityCode=" + activityCode + " ]";
    }

}